package com.example.publishevent.event.listener;

import com.example.publishevent.event.PlaceOrderEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class OrderNotifyListener{

    /**
     * 订阅事件
     */
    @Async("asyncExecutor")
    @EventListener
    public void notify(PlaceOrderEvent event) {
        log.info("[afterPlaceOrder] notify.");
    }
}